/* ******************************************************************
 * This file is part of the escal project and distributed under the
 * terms of the GNU General Public License Version 3
 * Copyright (C) 2008 Epocher (xijiaosdq@gmail.com)
 * See COPYING file for licensing information.
 *******************************************************************/

#ifndef LINK_MANAGER_H
#define LINK_MANAGER_H
#include "file_manager.h"
#include <QUrl>
#include <QString>
#include <QTime>
#include <QThread>

class QTextCursor;
class QTextDocument;

class BaseLinkManager:public QThread{
	Q_OBJECT
public:
	BaseLinkManager(QObject *parent=0);
	virtual ~BaseLinkManager() {};
	virtual bool hasError() { return error; };
	virtual void cleanUp()=0;
	virtual void stop()=0;
	virtual QTextDocument *getTextDocument() { return textDocument; };
	virtual QTextCursor *getTextCursor() {return textCursor;};
signals:
	void linkQuited(BaseLinkManager *link, bool error);
	void writeLog(QTextCursor *cursor, QString text1, QString text2);
protected:
	bool error;
	QTextCursor *textCursor;
	QTextDocument *textDocument;
};

#endif /* LINK_MANAGER_H */
